-
Notifications
You must be signed in to change notification settings - Fork 822
[Inference Providers] add image-to-image
support for fal.ai provider
#3187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the image-to-image
task to the Fal.AI inference provider.
- Implements
FalAIImageToImageTask
with payload preparation and response handling - Adds unit tests for payload and response flows
- Registers the new task in both sync/async clients and updates the docs
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/test_inference_providers.py | Adds tests for image-to-image payload generation and response |
src/huggingface_hub/inference/_providers/fal_ai.py | Implements FalAIImageToImageTask and refactors queue logic |
src/huggingface_hub/inference/_providers/init.py | Registers FalAIImageToImageTask in provider mapping |
src/huggingface_hub/inference/_generated/_async_client.py | Hooks get_response into async image_to_image |
src/huggingface_hub/inference/_client.py | Hooks get_response into sync image_to_image |
docs/source/en/guides/inference.md | Updates feature support table for image_to_image |
Comments suppressed due to low confidence (2)
tests/test_inference_providers.py:426
- Add
import base64
at the top of this test file so thatbase64.b64encode
is defined.
}
src/huggingface_hub/inference/_providers/fal_ai.py:232
- This
return
looks mis-indented (and missing the+
prefix in the diff), which will cause a syntax or scope error. It should be indented to align with the rest of the method body.
return get_session().get(url).content
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
return f"/{mapped_model}" | ||
|
||
|
||
class FalAIQueueTask(TaskProviderHelper, ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Conceptually LGTM, thanks
…pport-image-to-image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
huggingface#3187) * add image-to-image support for fal-ai * add tests * fix * use helper
Same PR as: huggingface/huggingface.js#1563 but in Python.
Tested the PR with https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev with both local and URL images, it works as expected ✅